﻿<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="MyBlog._Default" %>

<asp:Content runat="server" ID="FeaturedContent" ContentPlaceHolderID="FeaturedContent">
    <section class="featured">
        <div class="content-wrapper">
            <hgroup class="title">
                <h1>Blog</h1>

                <h2>Welcome to My Blog<br />
                </h2>

            </hgroup>

        </div>
    </section>
</asp:Content>
<asp:Content runat="server" ID="BodyContent" ContentPlaceHolderID="MainContent">

    <asp:EntityDataSource ID="EntityDataSourcePost" runat="server"
        ConnectionString="name=MyBlogDBEntities" DefaultContainerName="MyBlogDBEntities"
        EnableFlattening="False" EntitySetName="Posts" EntityTypeFilter=""
        OrderBy="it.PostDate DESC" Select="">
    </asp:EntityDataSource>   

    <asp:ListView ID="ListViewPosts" runat="server"
        DataSourceID="EntityDataSourcePost">
        <ItemTemplate>
            <div class="post">
                <h3><%#Server.HtmlEncode((string)Eval("Title")) + "("  + ")" %></h3>
                <div class="postDate"><%#Eval("PostDate") %></div>
                <div class="postContent">
                    <%#Server.HtmlEncode((string)Eval("PostContent")) %>
                     </div>
            </div>
        </ItemTemplate>
    </asp:ListView>
    <asp:DataPager ID="DataPagerPost" runat="server" PagedControlID="ListViewPosts">
        <Fields>
            <asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True" ShowLastPageButton="True" />
        </Fields>
    </asp:DataPager>
</asp:Content>
